package com.example.group_20.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.group_20.entity.Chat;
import com.example.group_20.entity.Students;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author: 栋
 * @data: 2023/8/20
 * @descriptions:
 */
@Mapper
public interface ChatMapper extends BaseMapper<Chat> {
    @Select("select * from chatinfor where id=#{id}")
    public Chat findByid(int id);
    @Select("select * from chatinfor where sent_id=#{id}")
    public List<Chat> findBySentId(String id);
    @Select("select * from chatinfor where recv_id=#{id}")
    public List<Chat>findByReciveId(String id);
    @Update("update chatinfor set response=#{response},resp_date=#{resp_date},resp_time=#{resp_time},status=#{status} where id=#{id}")
    public int updateChatInfor(Chat chat);


}
